﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yipusoft.Common.BLL;
using Yipusoft.Common.Model;

public partial class PageError : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DealError();
        }
    }
    private void DealError()
    {
        HttpException error = new HttpException();
        string strCode = error.ErrorCode.ToString();
        string strMsg = error.Message;
        error.HelpLink = "sss";
        Response.Write("ErrorCode:" + strCode + "<br>");
        Response.Write("Message:" + strMsg + "<br>");
        Response.Write("HelpLink:" + error.HelpLink + "<br>");
        Response.Write("Source:" + error.Source + "<br>");
        Response.Write("TargetSite:" + error.TargetSite + "<br>");
        Response.Write("InnerException:" + error.InnerException + "<br>");
        Response.Write("StackTrace:" + error.StackTrace + "<br>");
        Response.Write("GetHtmlErrorMessage:" + error.GetHtmlErrorMessage() + "<br>");
        Response.Write("error.GetHttpCode().ToString():" + error.GetHttpCode().ToString() + "<br>");
        Response.Write("error.Data.ToString()::" + error.Data.ToString() + "<br>");

        ErrorLogInfo log = new ErrorLogInfo();
        log.ErrorTime = DateTime.Now;
        log.UserName = Context.User.Identity.Name;
        log.ErrorNumber = 1;
        log.ErrorSeverity = 1;
        log.ErrorState = 1;
        log.ErrorProcedure = "";
        log.ErrorLine = 1;
        log.ErrorMessage = error.Message;
        ErrorLog.Insert(log);
    }
}
